/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ATBMS.view.useredit;

import ATBMS.control.EditUserControl;
import ATBMS.modles.User;
import java.awt.Frame;

/**
 *
 */
public class EditUserViewImpl extends UserEditViewImpl {

    private EditUserControl euc;

    public EditUserViewImpl(Frame parent, EditUserControl euc, User user) {
        super(parent);
        this.euc = euc;

        nameTextField.setText(user.getUname());
        nameTextField.setEnabled(false);
        addressTextField.setText(user.getUaddr());
        emailTextField.setText(user.getUemail());
        telTextField.setText(user.getUtel());

        okButton.setAction(euc.getAction());
        okButton.setText("Save");
        okButton.setActionCommand("Save");

        cancelButton.setAction(euc.getAction());
        cancelButton.setActionCommand("Cancel");
        cancelButton.setText("Cancel");
        
        setTitle("Edit Information");
        rootPane.setDefaultButton(okButton);
        addWindowListener(euc.getWindowListener());
    }
}
